--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 #  Economic Distress and Electoral Consequences: Evidence from Appalachia
 #
 #  Daniel Firoozi
 #  01/04/2021
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This folder contains the programs and code necessary to replicate the results 
in the paper. The code was created using Stata 17. 

Please note the data statement at the end of this document.


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 # LIST OF DO-FILES
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

DataCleaning_REStat_Final.do
Script_REStat_Final.do


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 # LIST OF TABLES AND FIGURES WITH MARKER TO SOURCE CODE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

main paper

figure 1    Lines 3035 to 3081                           Script_REStat_Final.do
figure 2    Lines 1269 to 1305                           Script_REStat_Final.do
figure 3    Lines 1610 to 1661                           Script_REStat_Final.do
figure 4    Lines 1308 to 1337                           Script_REStat_Final.do
figure 5    Lines 1663 to 1704                           Script_REStat_Final.do


table  1     Lines 28 to 45                              Script_REStat_Final.do
table  2     Lines 997 to 1076                           Script_REStat_Final.do
table  3     Lines 1103 to 1172                          Script_REStat_Final.do
table  4     Lines 1173 to 1233                          Script_REStat_Final.do
table  5     Lines 2130 to 2164                          Script_REStat_Final.do



online appendices

figure 6     Use d_2party2004 and d_2party2016           Created manually in QGIS
figure 7     Lines 1790 to 1806                          Script_REStat_Final.do
figure 8     Lines 50 to 72                              Script_REStat_Final.do
figure 9     Lines 79 to 366                             Script_REStat_Final.do
figure 10    Lines 79 to 366                             Script_REStat_Final.do
figure 11    Lines 819 to 864                            Script_REStat_Final.do
figure 12    Lines 367 to 815                            Script_REStat_Final.do
figure 13    Lines 367 to 815                            Script_REStat_Final.do
figure 14    Lines 367 to 815                            Script_REStat_Final.do
figure 15    Lines 915 to 994                            Script_REStat_Final.do
figure 16    Lines 1340 to 1469                          Script_REStat_Final.do
figure 17    Lines 2392 to 2518                          Script_REStat_Final.do
figure 18    Lines 2520 to 2646                          Script_REStat_Final.do
figure 19    Lines 2648 to 2774                          Script_REStat_Final.do
figure 20    Lines 2776 to 2902                          Script_REStat_Final.do
figure 21    Lines 2904 to 3030                          Script_REStat_Final.do
figure 22    Lines 3082 to 3131                          Script_REStat_Final.do
figure 23    Lines 3133 to 3162                          Script_REStat_Final.do
figure 24    Lines 3165 to 3364                          Script_REStat_Final.do
figure 25    Lines 3165 to 3364                          Script_REStat_Final.do
figure 26    Lines 1306 to 1335                          Script_REStat_Final.do
figure 27    Lines 1472 to 1602                          Script_REStat_Final.do
figure 28    Lines 3613 to 3662                          Script_REStat_Final.do
figure 29    Lines 1927 to 2127                          Script_REStat_Final.do
figure 30    Lines 1807 to 1926                          Script_REStat_Final.do
figure 31    Lines 3380 to 3410                          Script_REStat_Final.do
figure 32    Lines 3843 to 3850                          Script_REStat_Final.do
figure 33    Lines 3790 to 3808                          Script_REStat_Final.do
figure 34    Lines 3810 to 3840                          Script_REStat_Final.do
figure 35    From ARC admin docs                           

table  6     Created manually from ARC admin docs        LaTeX
table  7     Created manually from ARC admin docs        LaTeX
table  8     Created manually from ARC admin docs        LaTeX
table  9     Lines 869 to 916                            Script_REStat_Final.do
table  10    Lines 2325 to 2389                          Script_REStat_Final.do
table  11    Lines 3526 to 3610                          Script_REStat_Final.do
table  12    Lines 3476 to 3524                          Script_REStat_Final.do
table  13    Lines 997 to 1076                           Script_REStat_Final.do
table  14    Lines 3667 to 3771                          Script_REStat_Final.do
table  15    Line 2170                                   Script_REStat_Final.do
table  16    Lines 2202 to 2221                          Script_REStat_Final.do
table  17    Lines 3420 to 3443                          Script_REStat_Final.do
table  18    Lines 2173 to 2198                          Script_REStat_Final.do
table  19    Lines 3446 to 3467                          Script_REStat_Final.do
table  20    Lines 2227 to 2246                          Script_REStat_Final.do
table  21    Lines 2250 to 2316                          Script_REStat_Final.do


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 # LIST OF VARIABLES IN THE MAIN DATASET
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Variable       Obs Unique       Mean        Min       Max  Label
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
fipscode      2568    428   34613.92       1007     54109  FIPS
state         2568     13   7.380841          1        13  State
County        2568    318          .          .         .  County
urate2009     2568     70   5.869159        2.7      12.1  Lagged Unemployment Rate used in FY09
income2009    2568    416   18433.27       8703     36314  Lagged Per Capita Market Income used in FY09
prate2009     2568    188   16.32664        5.2      45.4  Lagged Unemployment Rate used in FY09
urate_s~2009  2568    343   115.6967       53.7     239.3  Lagged Scaled Unemployment Rate used in FY09
income_~2009  2568    361   168.4133       80.7     336.9  Lagged Scaled Per Capita Market Income used in FY09
prate_s~2009  2568    362   131.8986         42     366.6  Lagged Scaled Unemployment Rate used in FY09
composi~2009  2568    351   138.6682       61.8     274.1  Composite Rescaled Index in FY09
rankind~2009  2568    420   1986.736         45      3093  Composite Rescaled County Rank in FY09
countyl~2009  2568      5   3.906542          1         5  County Label for FY09 (Announced Summer 08)
fipscode_arc  2568    420   34604.23       1007     54109  ARC-Designated FIPS Crosswalk
stname        2568     13          .          .         .  State Name
ctyname       2568    318          .          .         .  County Name
hsgradrate    2568    234   71.11589       49.2      91.4  Percent Completed High School
bachrate      2568    167   12.99509        4.9      47.5  Percent Completed College
hs_scaled     2568    255   88.44977       61.2     113.6  High School Completion, Percent of U.S. Average
coll_scaled   2568    306   53.26589       20.2     194.5  College Completion, Percent of U.S. Average
democrat2000  2568    417   8893.294        339    329963  Democratic Presidential Votes 2000
republi~2000  2568    422    11345.4        630    235361  Republican Presidential Votes 2000
d_2party2000  2568    428   .4164659   .1466527  .8753997  Democratic Presidential 2-Party Vote 2000
democrat2004  2568    425   9726.881        413    368912  Democratic Presidential Votes 2004
republi~2004  2568    421   14032.48        670    271925  Republican Presidential Votes 2004
d_2party2004  2568    428   .3850472   .1496691   .832444  Democratic Presidential 2-Party Vote 2004
democrat2008  2568    422   10443.03        381    373153  Democratic Presidential Votes 2008
republi~2008  2568    420    14381.4        533    272347  Republican Presidential Votes 2008
d_2party2008  2568    428   .3803423   .1442719   .871289  Democratic Presidential 2-Party Vote 2008
democrat2012  2568    418    9404.18        283    352687  Democratic Presidential Votes 2012
republi~2012  2568    426   14527.27        579    262039  Republican Presidential Votes 2012
d_2party2012  2568    428   .3415747   .0888752  .8717232  Democratic Presidential 2-Party Vote 2012
democrat2016  2568    423   8427.278        222    367617  Democratic Presidential Votes 2016
republi~2016  2568    424   16270.07        759    259480  Republican Presidential Votes 2016
d_2party2016  2568    428   .2642244   .0861883   .840947  Democratic Presidential 2-Party Vote 2016
DMA           2568     43   71.42523          1       204  Nielsen DMA Code
dma           2568     43          .          .         .  DMA
arcsearch     2568     18   25.76869          0       100  ARC Awareness Index
dhouse_~2004  2568    321   .3672944          0         1  Democratic House 2-Party Vote 2004
dhouse_~2008  2568    347   .4970344          0         1  Democratic House 2-Party Vote 2008
dhouse_~2010  2568    387   .3460248          0  .8333111  Democratic House 2-Party Vote 2010
dhouse_~2012  2568    411    .340771          0  .8308211  Democratic House 2-Party Vote 2012
dhouse_~2014  2568    345   .2711832          0         1  Democratic House 2-Party Vote 2014
dhouse_~2016  2568    349   .2433838          0         1  Democratic House 2-Party Vote 2016
dhouse_~2018  2568    424   .3173357   .0912745         1  Democratic House 2-Party Vote 2018
electionyear  2568      6       2013       2008      2018  Election Year of erate, d_2party, and dhouse_2party
d_2party      1284   1284   .3287138   .0861883  .8717232  Democratic Presidential 2-Party Vote in (electionyear)
over65        2568    428   .1836027   .0743684  .3030942  Share of Adults over 65 in 2006
fns_waived    2568      9   .7706776          0         1  County Waiver from SNAP ABAWD Requirements
federalexp~p  2568    428   1858.495   213.0253  10338.62  Total Federal Grant Spending per Capita
statename     2568     13          .          .         .  State
countyname    2568    318          .          .         .  County
total_prov    2568     28   11.38084          1        33  Total ISPs in County in 2008
DTVsignal     2568     20   4.264019          0        19  Number of Strong and Moderate Signal DTV Channels
ElevFt        2568    309   2343.418        450      6684  Maximum Mountain Peak Elevation in Feet
d_2party1996  2568    428   .4996083   .2332024  .8767021  Democratic Presidential 2-Party Vote in 1996
netflow       2568    381   117.1682      -2639     11559  Net Migration to County 2007-2013
dhouse_2pa~y  2568   2254   .3359555          0         1  Democratic House 2-Party Vote in (electionyear)
erate2006     2568    428   .4844673   .1653941  1.594878  County Adult Employment Rate in 2006
erate         2568   2566   .4726398          0  1.571926  County Adult Employment Rate in 2006
density       2568    428   116.5406   5.227721   2567.47  Population Density
rindex2009    2568    420   64.00567   1.449742  99.64562  Approximate Percentile Rank of County
normrin~2009  2568    420  -25.99433  -88.55025  9.645622  Approximate Normalized Percentile Rank of County
generos~2009  2568      5   .5780374          0        .8  General Grant Matching Rate
LDDgene~2009  2568      3   .5856308         .5       .75  LDD Grant Matching Rate
ADHSgen~2009  2568      1         .8         .8        .8  ADHS Grant Matching Rate
Roadgen~2009  2568      2   .7696262         .3        .8  Rural Road Grant Matching Rate
countyg~2009  2568      5   3.492991          1         5  County Label for FY09 (Announced Summer 08)
attainm~2009  2568      2   .0163551          0         1  County is Attainment for FY09
competi~2009  2568      2   .0443925          0         1  County is Competitive for FY09
transit~2009  2568      2   .5584112          0         1  County is Transitional for FY09
atrisk2009    2568      2   .1915888          0         1  County is At-Risk for FY09
distres~2009  2568      2   .1892523          0         1  County is Distressed for FY09
totfunding~p  2568    421   18.86993          0   491.568  Total ARC Funding per Capita in 2008
truematch     2520    150    .486434   .0219143  .9184251  True ARC Match Rate in 2008
index2009     2568    351  -31.28178    -108.15    104.15  Normalized Composite Score Value for FY09
index         2568   1350  -25.24661    -110.25     133.6  Normalized Composite Index Score for FY announced in (electionyear)
distressed    2568      2   .2017134          0         1  County is Distressed for FY announced in (electionyear)
tag2009       2568      2   .1892523          0         1  County Normalized Composite Score Value for FY09 is >0
tag2011       2568      2   .1915888          0         1  County Normalized Composite Score Value for FY11 is >0
pshift        1284   1283  -.0563334  -.4331638  .1931765  2-Party Democratic Presidential Vote Shift 04-08
media         2568    427  -3.86e-10   -2.00683  4.194852  Media Penetration Index
tippingp~538  2568     14   .0200943          0       .32  538 Tipping Point Probability in (electionyear)
futtag        2568      6   .2042056          0         1  Total Distressed Ratings in Election Years
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 # DATA STATEMENT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Raw data from Dave Leip's Election Atlas for the US House of Representatives and 1996 presidential
election are proprietary, but are accessible at uselectionatlas.org for a fee.

Raw data on SNAP count ABAWD waivers are proprietary to Kye Lippold. A formatted version of these
data are provided.

Raw NewsBank Inc. data are proprietary to NewsBank Inc.. A formatted version of these data are pro
-vided.

All other data are publicly available and raw files are provided.

